<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>deltapxw</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="deltapx.html" title="deltapx" />
    <link rel="next" href="denorm.html" title="denorm" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">deltapxw</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="deltapx.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="denorm.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="deltapxw"></a>
      <div class="titlepage"></div>
      <a id="IndexDeltapxw" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">deltapxw</span>
        </h2>
        <p>deltapxw — 
      Mixes the input signal to a delay line.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98963904"></a>
        <h2>Description</h2>
        <p>
      <span class="emphasis"><em>deltapxw</em></span> mixes the input signal to a delay line. This opcode can be mixed with reading units (<a class="link" href="deltap.html" title="deltap"><em class="citetitle">deltap</em></a>, <a class="link" href="deltapn.html" title="deltapn"><em class="citetitle">deltapn</em></a>, <a class="link" href="deltapi.html" title="deltapi"><em class="citetitle">deltapi</em></a>, <a class="link" href="deltap3.html" title="deltap3"><em class="citetitle">deltap3</em></a>, and <a class="link" href="deltapx.html" title="deltapx"><em class="citetitle">deltapx</em></a>) in any order; the actual delay time is the difference of the read and write time. This opcode can read from and write to a <a class="link" href="delayr.html" title="delayr"><em class="citetitle">delayr</em></a>/<a class="link" href="delayw.html" title="delayw"><em class="citetitle">delayw</em></a> delay line with interpolation. 
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98972160"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>deltapxw</strong></span> ain, adel, iwsize</pre>
      </div>
      <div class="refsect1">
        <a id="idp98974208"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>iwsize</em></span> -- interpolation window size in samples. Allowed values are integer multiplies of 4 in the range 4 to 1024. <span class="emphasis"><em>iwsize</em></span> = 4 uses cubic interpolation.  Increasing <span class="emphasis"><em>iwsize</em></span> improves sound quality at the expense of CPU usage, and minimum delay time.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98976928"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>ain</em></span> -- Input signal.
    </p>
        <p>
      <span class="emphasis"><em>adel</em></span> -- Delay time in seconds.
    </p>
        <p>
      </p>
        <div class="informalexample">
          <pre class="programlisting">
a1      <span class="opc">delayr</span>   idlr
        <span class="opc">deltapxw</span> a2, adl1, iws1
a3      <span class="opc">deltapx</span>  adl2, iws2
        <span class="opc">deltapxw</span> a4, adl3, iws3
        <span class="opc">delayw</span>   a5</pre>
        </div>
        <p>
    </p>
        <p>
      Minimum and maximum delay times:

      </p>
        <div class="informalexample">
          <pre class="programlisting">
idlr &gt;= 1/kr                                Delay line length
 
adl1 &gt;= (iws1/2)/sr                         Write before read
adl1 &lt;= idlr - (1 + iws1/2)/sr              (allows shorter delays)
 
adl2 &gt;= 1/kr + (iws2/2)/sr                  Read time
adl2 &lt;= idlr - (1 + iws2/2)/sr
adl2 &gt;= adl1 + (iws1 + iws2) / (2*sr)
adl2 &gt;= 1/kr + adl3 + (iws2 + iws3) / (2*sr)
 
adl3 &gt;= (iws3/2)/sr                         Write after read
adl3 &lt;= idlr - (1 + iws3/2)/sr              (allows feedback)
        </pre>
        </div>
        <p>
    </p>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note: Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
        Window sizes for opcodes other than <span class="emphasis"><em>deltapx</em></span> are: <span class="emphasis"><em>deltap</em></span>, <span class="emphasis"><em>deltapn</em></span>: 1, <span class="emphasis"><em>deltapi</em></span>: 2 (linear), <span class="emphasis"><em>deltap3</em></span>: 4 (cubic)
      </p>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp98990304"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the deltapxw opcode. It uses the file <a class="ulink" href="examples/deltapxw.csd" target="_top"><em class="citetitle">deltapxw.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp98992080"></a>
          <p class="title">
            <strong>Example 191. Example of the deltapxw opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac     <span class="comment">;;;RT audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if RT audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o deltapxw.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span>     <span class="op">=</span> 44100
<span class="ohdr">ksmps</span>  <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span> <span class="op">=</span> 1

<span class="oblock">instr</span> 1

a1      <span class="opc">phasor</span>   300
a1      <span class="op">=</span>  a1 <span class="op">-</span> 0.5
a_      <span class="opc">delayr</span>   1
adel    <span class="opc">phasor</span>   4
adel    <span class="op">=</span>  <span class="opc">sin</span>(2 <span class="op">*</span> 3.14159265 <span class="op">*</span> adel) <span class="op">*</span> 0.01 <span class="op">+</span> 0.2
        <span class="opc">deltapxw</span> a1, adel, 32
adel    <span class="opc">phasor</span>   2
adel    <span class="op">=</span>  <span class="opc">sin</span>(2 <span class="op">*</span> 3.14159265 <span class="op">*</span> adel) <span class="op">*</span> 0.01 <span class="op">+</span> 0.2
        <span class="opc">deltapxw</span> a1, adel, 32
adel    <span class="op">=</span>  0.3
a2      <span class="opc">deltapx</span>  adel, 32
a1      <span class="op">=</span>  0
        <span class="opc">delayw</span>   a1
        <span class="opc">outs</span>     a2<span class="op">*</span>.7, a2<span class="op">*</span>.7
<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">i</span>1 0 5
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98996368"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="deltapx.html" title="deltapx"><em class="citetitle">deltapx</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp98998416"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Istvan Varga</td>
          </tr>
          <tr>
            <td>August 2001</td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in version 4.13</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="deltapx.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="denorm.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">deltapx </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> denorm</td>
        </tr>
      </table>
    </div>
  </body>
</html>
